//rutinas para manejo de layers o divs

var fredlayer;
function fcambio(img,div) 
{
            if (is.ie) {
                document.all[div].innerHTML = '<img src="graficos/imagenes/'+img+'" alt="">';
            }
            if (is.ns) {
                document.titdiv.write('<img src="graficos/imagenes/'+img+'" alt="">');
                if (is.ns4) {
                    document.layers[div].document.open();
                    document.layers[div].document.write('<img src="graficos/imagenes/'+img+'" alt="">');
                    document.layers[div].document.close();
                } else if (is.ns5) {
                    document.getElementById(div).innerHTML = '<img src="graficos/imagenes/'+img+'" alt="">';;
                }
            } 
}
function fcambio1(img,div) 
{
            if (is.ie) {
                document.all[div].innerHTML = '<img src="'+img+'" alt="">';
            }
            if (is.ns) {
                document.titdiv.write('<img src="'+img+'" alt="">');
                if (is.ns4) {
                    document.layers[div].document.open();
                    document.layers[div].document.write('<img src="'+img+'" alt="">');
                    document.layers[div].document.close();
                } else if (is.ns5) {
                    document.getElementById(div).innerHTML = '<img src="'+img+'" alt="">';;
                }
            } 
}
function ftexto(texto,div) 
{
            if (document.all) {
							fredlayer = document.all[div];
							fredlayer.innerHTML=texto;
            }
            if (document.layers) {
							fredlayer = document.layers[div];
              fredlayer.document.open();
							fredlayer.document.write(texto);
							fredlayer.document.close();
            }
						if (!document.all && document.getElementById) {
							fredlayer = document.getElementById(div);
							fredlayer.innerHTML =texto;
            }
}

//rutina que abre una ventana
function NewWindow(mypage,myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',location=0,menubar=0,status=0,titlebar=0,toolbar=0,resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function urlselected(){
if (document.forma.image.checked==true)
{
	//window.location=document.forma.select.options[document.forma.select.selectedIndex].value
	window.location='image2.html';
}
else
{
	window.location='image.html';
}
}


function openpage()
{
location=document.forma.selecciona.options[document.forma.selecciona.selectedIndex].value;
}

//Check all, Uncheck all, Clean all

function check(formname,checkname,radio,thestate){
var el_collection=eval("document.forms."+formname+"."+checkname)
el_collection[radio].checked=thestate
}

//Percent Results

function results(contenido){
var str_buffer = new String (
	'<html>\n'+
	'<head>\n'+
	'	<title>Porcentaje de respuestas</title>\n'+
	'	<link rel="stylesheet" href="styles/style.css" type="text/css">\n'+
	'</head>\n'+
	'<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">\n'+
	'<table border="0" cellpadding="5" cellspacing="1"><tr><td><img src="images/head2.jpg" height="17" width="190" alt=""></td></tr></table>'
	);
	str_buffer +=
	contenido+
	'</body>\n'+
	'</html>\n';

	var vWinCal = window.open("", "Resultados","width=400,height=300,status=no,resizable=yes,top=200,left=200,scrollbars=yes");
	vWinCal.opener = self;
	var calc_doc = vWinCal.document;
	calc_doc.write (str_buffer);
	calc_doc.close();
}

function framePrint(whichFrame){
parent[whichFrame].focus();
parent[whichFrame].print();
}